package com.notes.action;

import java.io.IOException;

import javax.faces.application.FacesMessage;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Component;

@Component(value="logoutAction")
@SessionScoped
public class LogoutAction {

	public void LogoutAction() throws IOException{
		
		FacesContext.getCurrentInstance().getExternalContext()
        .invalidateSession();
		FacesContext.getCurrentInstance().getExternalContext().redirect("index.xhtml");
		
	}
}
